package cn.lqz.bucttrain.enums;

/**
 * 列车状态枚举
 */
public enum TrainStatusEnum {
    DISABLE(0,"禁用"),
    ENABLE(1,"启用"),
    FIX(2,"维修");
    private Integer status;
    private String description;

    TrainStatusEnum(Integer status,String description){
        this.status = status;
        this.description = description;
    }

    public static TrainStatusEnum getByStatus(Integer status){
        for (TrainStatusEnum value : TrainStatusEnum.values()) {
            if (value.status.equals(status)){
                return value;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }
    public String getDescription(){
        return description;
    }
}
